$server = 'http://localhost:8080/';
window.onload = function(){
	$.ajax({
		url: $server + 'order/list.do',
		datatype: 'json',
		type: 'POST',
		corssDomain: true,
		xhrFields:{
			withCredentials: true // 携带跨域cookie
		},
		success: function(result){
			console.log(result);
			
			if (result.code == 200){				
				$htmlstr = '';
				$.each(result.data.list, function(index, value){
				$htmlstr +=	'<li>' +
					    '<div>' +
					        '<span>'+value.createTime+'</span>' +
					        '<span>订单号： <a href=orderDetail.html?orderNo='+value.orderNo+'>'+value.orderNo+'</a></span>' +
					    '</div>' +
					    '<div>' +
					        '<div>' +
					            '<img src="img/wangwang.jpg" alt="">' +
					            '<p>'+value.orderItemVoList[0].commodityName+'</p>' +
					            '<span>x'+value.orderItemVoList.length+'</span>' +
					        '</div>' +
					        '<div>'+value.receiverName+'</div>' +
					        '<div>' +
					            '<ul>' +
					                '<li>总额 ¥'+value.payment+'</li>' +
					                '<li>'+value.paymentTypeDesc+'</li>' +
					            '</ul>' +
					        '</div>' +
					        '<div>' +
					            '<a href="#" style="color: #fdc3aa">'+value.statusDesc+'</a>' +
					            '<a href="#">订单跟踪</a>' +
					            '<a href="#">取消订单</a>' +
					        '</div>' +
					        '<div><a  class="cancelEvn">取消订单</a></div>' +
					    '</div>' +
					'</li>';
				});
				$('.orderPage_Shop')[0].innerHTML = $htmlstr;
				
			}else{
				alert(result.msg);
			}
		},
		error: function(XMLHttpRequest, textStatus, errorThrown){
			alert(textStatus);
		}
	});
}